package UIFree.controls
{
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;
	
	import flash.geom.Rectangle;

	public class uif_panel extends uif_ecomponent {
		private var _title: uif_label;
		public function uif_panel(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
			createTitle();
		}
		
		protected function createTitle(): void {
			var titleStyle: Object = style.title?style.title:{};
			var inner: Rectangle = getInner(titleStyle.offsetX, titleStyle.offsetY, titleStyle.offsetWidth);
			_title = new uif_label(this, inner.x, inner.y, inner.width, style.titleHeight, titleStyle.styleClass);
		}
		
		public function get title(): uif_label {
			return _title;
		}
	}
}